package com.dotstone.chipism.ui.security.me;

import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dotstone.chipism.R;
import com.dotstone.chipism.activity.BaseActivity;
import com.dotstone.chipism.ui.security.dialog.CameraResetStatusDialog;
import com.dotstone.chipism.ui.security.dialog.LightsOutTipsDialog;
import com.dotstone.chipism.view.slidingfragmenu.BarUtils;

/**
 * 快速配置2
 */
public class FastconFigurationActivity2 extends BaseActivity {
    private LinearLayout mBackL;
    private TextView tv_statusBar_mian;
    private Button btn_wait_connect; //语音提示等待连接
    private Button btn_other_content;//指示灯常量
    private Button btn_no_hints;//指示灯熄灭

    @Override
    public void widgetClick(View v) {
        switch (v.getId()){
            //语音提示等待连接
            case R.id.btn_wait_connect:
                startActivity(RouterSetupActivity.class);
                break;
            //语音提示其他内容
            case R.id.btn_other_content:
                CameraResetStatusDialog.showDialog(this);
                break;
            //无语音提示
            case R.id.btn_no_hints:
                CameraResetStatusDialog.showDialog(this);
                break;
            //返回
            case R.id.back_layout:
                finish();
                break;
        }
    }

    @Override
    public void initParms(Bundle parms) {

    }

    @Override
    public View bindView() {
        return null;
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_fastcon_figuration2;
    }

    @Override
    public void initView(View view) {
        mBackL = $(R.id.back_layout);
        tv_statusBar_mian = $(R.id.tv_statusBar_mian);
        btn_wait_connect = $(R.id.btn_wait_connect);
        btn_other_content = $(R.id.btn_other_content);
        btn_no_hints = $(R.id.btn_no_hints);
    }

    @Override
    public void setListener() {
        mBackL.setOnClickListener(this);
        btn_wait_connect.setOnClickListener(this);
        btn_other_content.setOnClickListener(this);
        btn_no_hints.setOnClickListener(this);
        boolVersion();
    }

    @Override
    public void doBusiness(Context mContext) {

    }

    public void boolVersion() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

            Window window = getWindow();
            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            // 透明导航栏
//			getWindow().addFlags(
//					WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            // 改变titlebar的高度
            int statusbarHeight = BarUtils.getStatusBarHeight(this);
            RelativeLayout.LayoutParams layoutParams1 = (RelativeLayout.LayoutParams) tv_statusBar_mian
                    .getLayoutParams();
            layoutParams1.height = statusbarHeight;
            tv_statusBar_mian.setLayoutParams(layoutParams1);
            tv_statusBar_mian.setVisibility(View.VISIBLE);
        } else {
            tv_statusBar_mian.setVisibility(View.GONE);
        }
    }
}
